package com.jt.www.domain.enums.common;

import org.apache.commons.lang3.StringUtils;

/**
 *  {
 *           name: "保险公司出具延迟",
 *           code: "01",
 *         },
 *         {
 *           name: "框架协议/保险协议签署流程延迟",
 *           code: "02",
 *         },
 *         {
 *           name: "先出暂保单后出正式保单",
 *           code: "03",
 *         },
 *         {
 *           name: "协议约定",
 *           code: "04",
 *         },
 *         {
 *           name: "其他",
 *           code: "99",
 *         },
 *       ], //倒签原因
 */
public enum BacklogReasonEnum {

    ISSUANCEDELAY("01", "保险公司出具延迟"),
    FRAMEPROTOCOLDELAP("02", "框架协议/保险协议签署流程延迟"),
    BACKOUTPOLICY("03", "先出暂保单后出正式保单"),
    AGREEMENT("04", "协议约定"),
    OTHER("99", "其他");

    private String code;

    private String desc;

    BacklogReasonEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(String code) {
        if (StringUtils.isBlank(code)) {
            return "";
        }
        for (BacklogReasonEnum pushStatusEnum : BacklogReasonEnum.values()) {
            if (pushStatusEnum.code.equals(code)) {
                return pushStatusEnum.desc;
            }
        }
        return "";
    }


    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}


